package cn.sinocontrol.mqtt.publish;

import org.springframework.integration.annotation.MessagingGateway;
import org.springframework.integration.mqtt.support.MqttHeaders;
import org.springframework.messaging.handler.annotation.Header;
import org.springframework.stereotype.Component;

@Component
@MessagingGateway(defaultRequestChannel = "publishChannel")
public interface MqttMsgPublisher {

    /**
     * 推送消息
     * @param topic 主题
     * @param payload 消息内容
     */
    void publishMsg(@Header(MqttHeaders.TOPIC) String topic, String payload);
}
